package com.lvcoding.injection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author wuyanshen
 * @discription 描述
 * @date 2020-07-09 3:20 下午
 */
@Service
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    public UserDao getUserDao() {
        return userDao;
    }

    // @Autowired
    // @Qualifier("userDaoImpl")

    @Resource(name = "userDaoImpl")
    public void setUserDao(UserDao userDao) {
        System.out.println("UserServiceImpl.setUserDao");
        this.userDao = userDao;
    }

    @Override
    public void register() {
        userDao.save();
    }
}
